Prepare ui-graphics/ui-text for future upstreaming: extract skiko implementation into separate module#3126
Open
Ivan Matkov (MatkovIvan) wants to merge 4 commits into
Open
Prepare ui-graphics/ui-text for future upstreaming: extract skiko implementation into separate module#3126Ivan Matkov (MatkovIvan) wants to merge 4 commits into
Ivan Matkov (MatkovIvan) wants to merge 4 commits into
Conversation
1a3662d to
2181d8d
Compare
ApoloApps
reviewed
Jun 17, 2026
ApoloApps
reviewed
Jun 17, 2026
ApoloApps
reviewed
Jun 17, 2026
77b65c3 to
5a76df8
Compare
Move the Skia-backed implementation of ui-graphics into a new :compose:ui:ui-skiko module, leaving ui-graphics' nonAndroidMain Skia-free. The common code keeps thin expect/actual delegators that resolve a registered ComposeUiGraphicsImplementation at runtime; the real org.jetbrains.skia code lives in ui-skiko's Skiko*Support classes. Source-set topology: commonMain -> nonAndroidMain (Skia-free) -> skikoMain (Skia compat) -> desktop/native/web leaves. - Canvas/Paint/Path/PathEffect/PathMeasure/PathIterator/ImageBitmap/ Matrices/GraphicsLayer/Blur/Rects relocate to ui-skiko as registry- backed delegators. - The Skia-holding expect-class actuals (Shader, ColorFilter, BlurEffect/OffsetEffect/RenderEffect) become Skiko-free via the PlatformBindings pattern: an opaque @InternalComposeUiApi Platform* binding in ui-graphics, implemented in ui-skiko. - Public Skia-interop extensions (skiaPaint, skiaImageFilter, asComposePath, ...) move to ui-skiko keeping their original package and @file:JvmName facade anchors, preserving desktop binary compatibility. Deprecated Skia-returning members that cannot be extensions delegate through a temporary SkikoGraphicsCompat registry. API baselines are regenerated in a later commit.
Move the Skia-backed implementation of ui-text into ui-skiko, leaving ui-text's nonAndroidMain Skia-free, mirroring the graphics extraction. ui-text keeps expect/actual delegators resolving a registered ComposeUiTextImplementation; the org.jetbrains.skia paragraph, font and text-paint code lives in ui-skiko. - Paragraph building, intrinsics, char helpers and the font subsystem (FontFamilyResolver, font loading, PlatformFont) relocate to ui-skiko. - The font subsystem is ui-text's own public API with per-platform loadTypeface actuals, so the unavoidable public Skia-typed surface stays in ui-text's skikoMain compat layer (Skia-free nonAndroidMain -> Skia skikoMain -> platform leaves); only the implementation moves. - ComposeUiSkikoRuntime.registerSkikoComposeImplementation() now wires both the graphics and text implementations (plus the temporary SkikoGraphicsCompat bridge). API baselines are regenerated in a later commit.
5a76df8 to
2c65a47
Compare
Wire registerSkikoComposeImplementation() into the Skiko-backed Compose entry points so the ui-graphics/ui-text registries are populated before any scene is created: desktop ComposePanel/ComposeWindowPanel, macOS ComposeWindow, iOS ComposeUIViewController, web ComposeWindowInternal, ImageComposeScene, and the ui-test rules. Adds the :compose:ui:ui-skiko dependency to the modules that rely on the Skiko backend transitively (ui, ui-test, ui-test-junit4, foundation) and registers in the affected test harnesses.
Record the post-extraction public API. ui-graphics/ui-text baselines shrink by the relocation-only removals (the Skia-interop extensions and helpers now published from ui-skiko under identical package + facade names); no other public declarations change. Desktop binary compatibility is preserved through the @file:JvmName facade anchors and the HIDDEN split-facade shims in ui-skiko.
2c65a47 to
8a2981a
Compare
| @@ -222,6 +223,7 @@ androidXMultiplatform { | |||
| // TODO: Move to commonTest? | |||
| implementation(project(":compose:material:material")) | |||
| implementation(project(":compose:foundation:foundation")) | |||
| implementation(project(":compose:ui:ui-skiko")) | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| implementation(project(":compose:ui:ui-skiko")) |
skikoMain already contains it.
| @@ -1,88 +0,0 @@ | |||
| /* | |||
Collaborator
There was a problem hiding this comment.
Could you please separate moving files and changing them into separate commits? Without doing so, it is difficult to review.
Collaborator
Author
There was a problem hiding this comment.
Not sure I understand the specific shape you are requesting here.
This PR is not just about renaming but about extracting the logic into a new module and converting previous classes/functions to wrappers.
What moving do you mean? And despite of the answer - do you really want to have a separate commit with inconsistent/not-compilable state?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CMP-9813 Extract
ui-graphics/ui-textskiko implementation intoui-skikomoduleCMP-9814 Runtime registration of
ui-skikoRelease Notes
N/A